package com.controller;

import com.pojo.GoodsType;
import com.service.GoodsTypeService;
import com.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author lifeng
 * @create 2022-11-28 17:02
 */
@RestController
@RequestMapping("/goodsType")
@CrossOrigin
public class GoodsTypeController {

    @Autowired
    private GoodsTypeService goodsTypeService;

    @GetMapping("/list")
    public R getGoodsList(){
        List<GoodsType> list = goodsTypeService.findAll();
        return R.ok().data("goodsTypeList",list).setCode(200);
    }

}
